@()
@main("Umami taste phenotypes in numeric form(2015)-CBGD") {

	<div class="row">
		<div class="form-group col-sm-12">
			<h2 class="page-heading"
			style="text-align: left;
				border-bottom: 5px solid #e9f3f4">Umami taste phenotypes in numeric form(2015)
			</h2>
		</div>
	</div>
	<label>Select the columns to display:</label>
	<div id="checkbox" class="checkbox">

	</div>

	<div id="toolbar">
			&nbsp;Keyword：
	</div>

	<table class="display table table-bordered" id="table" data-search="true"
	data-toolbar="#toolbar" data-search-align="left" data-multiple-search="true"
	data-page-list="[10, 25, 50, 100, all]" data-pagination="true"
	style="table-layout: fixed;
		word-wrap: break-word">
		<thead>
			<tr>
				<th data-field='accession' data-sortable='true'>﻿Accession</th>
				<th data-field='total' data-sortable='true'>Total</th>
				<th data-field='asp' data-sortable='true'>Asp</th>
				<th data-field='thr' data-sortable='true'>Thr</th>
				<th data-field='ser' data-sortable='true'>Ser</th>
				<th data-field='glu' data-sortable='true'>Glu</th>
				<th data-field='gly' data-sortable='true'>Gly</th>
				<th data-field='ala' data-sortable='true'>Ala</th>
				<th data-field='cys' data-sortable='true'>Cys</th>
				<th data-field='val' data-sortable='true'>Val</th>
				<th data-field='met' data-sortable='true'>Met</th>
				<th data-field='ile' data-sortable='true'>Ile</th>
				<th data-field='leu' data-sortable='true'>Leu</th>
				<th data-field='tyr' data-sortable='true'>Tyr</th>
				<th data-field='phe' data-sortable='true'>Phe</th>
				<th data-field='gAba' data-sortable='true'>g-ABA</th>
				<th data-field='lys' data-sortable='true'>Lys</th>
				<th data-field='his' data-sortable='true'>His</th>
				<th data-field='arg' data-sortable='true'>Arg</th>
				<th data-field='pro' data-sortable='true'>Pro</th>
			</tr>
		</thead>
	</table>


	<script>
			$(function () {
				var array = ["Asp", "Thr", "Ser", "Glu", "Gly", "Ala", "Cys", "Val", "Met", "Ile", "Leu", "Tyr", "Phe", "g-ABA", "Lys", "His", "Arg", "Pro"]
				var values = ["asp", "thr", "ser", "glu", "gly", "ala", "cys", "val", "met", "ile", "leu", "tyr", "phe", "gAba", "lys", "his", "arg", "pro"]
				var html = ""
				$.each(array, function (n, value) {
							html += "<label style='margin-right: 15px'>" +
									"<input type='checkbox' checked='checked' value='" + values[n] + "' onclick=\"setColumns('" + values[n] + "')\">" + value +
									"</label>"
						}
				);
				$("#checkbox").append(html)

				$.ajax({
					url: "@routes.PhenotypeController.getAll2015Umamis()",
					type: "get",
					dataType: "json",
					success: function (data) {
						$('#table').bootstrapTable({
							data: data
						});

						var hiddenArray = ["ser", "glu", "gly", "ala", "cys", "val", "met", "ile", "leu", "tyr", "phe", "gAba", "lys", "his", "arg", "pro"]
						$.each(hiddenArray, function (n, value) {
									$('#table').bootstrapTable('hideColumn', value);
									$("input:checkbox[value=" + value + "]").attr("checked", false)
								}
						);
					}
				})

			})

			function setColumns(value) {
				var element = $("input:checkbox[value=" + value + "]")
				if (element.is(":checked")) {
					$('#table').bootstrapTable('showColumn', value);
				} else {
					$('#table').bootstrapTable('hideColumn', value);
				}
			}
	</script>
}